//
//  MIDIYuedongCell.m
//  迷笛
//
//  Created by . on 2018/9/18.
//  Copyright © 2018年 🍃🌺🌺🍃. All rights reserved.
//

#import "MIDIYuedongCell.h"

@implementation MIDIYuedongCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        [self addSubview:self.headimage];
        [self.headimage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_offset(WidthScale(18));
            make.left.mas_offset(WidthScale(26));
            make.width.mas_offset(WidthScale(50));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(50):HeightScale(50));
        }];
        [self addSubview:self.name];
        [self.name mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.headimage).offset(WidthScale(10));
            make.left.equalTo(self.headimage.mas_right).offset(WidthScale(10));
            make.height.mas_offset(HeightScale(10));

            [self.name setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.Focus];
        [self.Focus mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.name.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.name);
            make.height.mas_offset(HeightScale(20));

            [self.Focus setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.TZ];
        [self.TZ mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.Focus);
            make.left.equalTo(self.Focus.mas_right).offset(WidthScale(10));
            make.height.mas_offset(HeightScale(10));
            [self.TZ setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
//            make.bottom.mas_offset(-20);
        }];
        [self addSubview:self.XX];
        [self.XX mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.Focus.mas_bottom).offset(WidthScale(20));
            make.centerX.equalTo(self);
            make.width.mas_offset(WidthScale(380));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(1):HeightScale(1));
        }];
        
        
        
        
        [self addSubview:self.titleIntroduction];
        [self.titleIntroduction mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.XX.mas_bottom).offset(WidthScale(15));
            make.left.mas_offset(WidthScale(14));
            make.height.mas_offset(HeightScale(10));
            [self.titleIntroduction setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.Introduction];
        [self.Introduction mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleIntroduction.mas_bottom).offset(WidthScale(10));
        make.left.mas_offset(WidthScale(14));
        make.width.mas_offset(WidthScale(342));
//        make.height.mas_offset(HeightScale(40));
        make.bottom.mas_offset(WidthScale(-10));
        }];
        
        [self addSubview:self.headimage1];
        [self.headimage1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_offset(WidthScale(16));
            make.left.mas_offset(WidthScale(15));
            make.width.mas_offset(WidthScale(40));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(40):HeightScale(40));
        }];
        [self addSubview:self.Name];
        [self.Name mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.headimage1);
            make.left.equalTo(self.headimage1.mas_right).offset(WidthScale(10));
            
            [self.Name setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.foucus];
        [self.foucus mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.headimage1);
            make.right.mas_offset(WidthScale(-20));
            make.width.mas_offset(WidthScale(50));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(25):HeightScale(25));
        }];
        [self addSubview:self.conunt];
        [self.conunt mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.foucus.mas_bottom).offset(WidthScale(20));
            make.left.equalTo(self.Name);
            make.width.mas_offset(WidthScale(275));
        }];
        [self addSubview:self.iamgeg1];
        [self.iamgeg1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.conunt.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.Name);
            make.width.mas_offset(WidthScale(96));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(96):HeightScale(96));
        }];
        [self addSubview:self.iamgeg2];
        [self.iamgeg2 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.conunt.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.iamgeg1.mas_right).offset(WidthScale(5));
            make.width.mas_offset(WidthScale(96));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(96):HeightScale(96));
        }];
        [self addSubview:self.iamgeg3];
        [self.iamgeg3 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.conunt.mas_bottom).offset(WidthScale(10));
            make.left.equalTo(self.iamgeg2.mas_right).offset(WidthScale(5));
            make.width.mas_offset(WidthScale(96));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(96):HeightScale(96));
//            make.bottom.mas_offset(WidthScale(-20));
        }];
        
        
        
        
        [self addSubview:self.commtext];
        [self.commtext mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.iamgeg1.mas_bottom).offset(WidthScale(10));
            make.right.mas_offset(WidthScale(-20));
             [self.commtext setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.comm];
        [self.comm mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.commtext);
            make.right.equalTo(self.commtext.mas_left).offset(WidthScale(-5));
            make.width.mas_offset(WidthScale(23));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(23):HeightScale(23));
            make.bottom.mas_offset(WidthScale(-20));
        }];
        
        [self addSubview:self.number];
        [self.number mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.equalTo(self.iamgeg1.mas_bottom).offset(WidthScale(10));
            make.right.equalTo(self.comm.mas_left).offset(WidthScale(-20));
            [self.number setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
        [self addSubview:self.love];
        [self.love mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.commtext);
            make.right.equalTo(self.number.mas_left).offset(WidthScale(-5));
            make.width.mas_offset(WidthScale(23));
            make.height.mas_offset(kDevice_Is_iPhoneX?HeighX(23):HeightScale(23));
        }];
        [self addSubview:self.daytime];
        [self.daytime mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self.love);
            make.left.mas_offset(WidthScale(20));
            [self.daytime setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
        }];
 

    }
    return self;
}
//- (void)prepareForReuse
//{
//     [super prepareForReuse];
//    [self.headimage setBackgroundImage:[UIImage imageNamed:@""] forState:0];
//    self.name.text = @"";
//    self.Focus.text = @"";
//    self.TZ.text = @"";
//    self.titleIntroduction.text  =@"";
//    self.Introduction.text  =@"";
//    [self.headimage1 setBackgroundImage:[UIImage imageNamed:@""] forState:0];
//    self.Name.text =@"";
////    [self.foucus setBackgroundImage:[UIImage imageNamed:@""] forState:0];
//    self.conunt.text = @"";
//    self.iamgeg1.image =[UIImage imageNamed:@""];
//    self.iamgeg2.image =[UIImage imageNamed:@""];
//    self.iamgeg3.image =[UIImage imageNamed:@""];
////    [self.love setBackgroundImage:[UIImage imageNamed:@""] forState:0];
//    self.number.text = @"";
//    [self.comm setBackgroundImage:[UIImage imageNamed:@"'"] forState:0];
//    self.commtext.text = @"";
//}

-(UIButton *)headimage
{
    if (!_headimage)
    {
        _headimage =[[UIButton alloc]init];
        _headimage.layer.masksToBounds = YES;
        [_headimage.layer setCornerRadius:WidthScale(25)]; //设置矩圆角半径
    }
    return _headimage;
}
-(UILabel *)name
{
    if (!_name)
    {
        _name =[[UILabel alloc]init];
        _name.textColor = [UIColor colorWithHexString:@"#FFFEFE"];
        _name.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _name;
}
-(UILabel *)Focus
{
    if (!_Focus)
    {
        _Focus =[[UILabel alloc]init];
        _Focus.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _Focus.font =[UIFont systemFontOfSize:WidthScale(12)];
    }
    return _Focus;
}
-(UILabel *)TZ
{
    if (!_TZ)
    {
        _TZ =[[UILabel alloc]init];
        _TZ.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _TZ.font =[UIFont systemFontOfSize:WidthScale(12)];
    }
    return _TZ;
}
-(UILabel *)titleIntroduction
{
    if (!_titleIntroduction)
    {
        _titleIntroduction =[[UILabel alloc]init];
        _titleIntroduction.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _titleIntroduction.font =[UIFont systemFontOfSize:WidthScale(12)];
    }
    return _titleIntroduction;
}
-(UILabel *)Introduction
{
    if (!_Introduction)
    {
        _Introduction =[[UILabel alloc]init];
        _Introduction.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _Introduction.font =[UIFont systemFontOfSize:WidthScale(12)];
        _Introduction.numberOfLines = 0;
//        _Introduction.backgroundColor =[UIColor redColor];
        _Introduction.lineBreakMode = NSLineBreakByWordWrapping;
        CGSize size = [_Introduction sizeThatFits:CGSizeMake(WidthScale(342), MAXFLOAT)];//根据文字的长度返回一个最佳宽度和高度
        _Introduction.frame = CGRectMake(0, 0, WidthScale(342), size.height);
    }
    return _Introduction;
}
//row3
-(UIButton *)headimage1
{
    if (!_headimage1)
    {
        _headimage1 =[[UIButton alloc]init];
        _headimage1.layer.masksToBounds = YES;
        [_headimage1.layer setCornerRadius:WidthScale(20)]; //设置矩圆角半径
    }
    return _headimage1;
}
-(UILabel *)Name
{
    if (!_Name)
    {
        _Name = [[UILabel alloc]init];
        _Name.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _Name.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _Name;
}
-(UIButton *)foucus
{
    if (!_foucus)
    {
        _foucus =[[UIButton alloc]init];
        _foucus.titleLabel.font =[UIFont systemFontOfSize:WidthScale(12)];
        _foucus.layer.masksToBounds = YES;
        [_foucus.layer setCornerRadius:WidthScale(5)];
    }
    return _foucus;
}
-(UILabel *)conunt
{
    if (!_conunt)
    {
        _conunt = [[UILabel alloc]init];
        _conunt.textColor = [UIColor colorWithHexString:@"#FFFEFE"];
        _conunt.font =[UIFont systemFontOfSize:WidthScale(15)];
        _conunt.numberOfLines = 0;
        _conunt.lineBreakMode = NSLineBreakByWordWrapping;
        CGSize size = [_Introduction sizeThatFits:CGSizeMake(WidthScale(200), MAXFLOAT)];//根据文字的长度返回一个最佳宽度和高度
        _conunt.frame = CGRectMake(0, 0, WidthScale(200), size.height);
    }
    return _conunt;
}
-(UIImageView *)iamgeg1
{
    if (!_iamgeg1)
    {
        _iamgeg1 =[[UIImageView alloc]init];
    }
    return _iamgeg1;
}
-(UIImageView *)iamgeg2
{
    if (!_iamgeg2)
    {
        _iamgeg2 =[[UIImageView alloc]init];
    }
    return _iamgeg2;
}
-(UIImageView *)iamgeg3
{
    if (!_iamgeg3)
    {
        _iamgeg3 =[[UIImageView alloc]init];
    }
    return _iamgeg3;
}
-(UIButton *)love
{
    if (!_love)
    {
        _love =[[UIButton alloc]init];
    }
    return _love;
}
-(UILabel *)number
{
    if (!_number)
    {
        _number =[[UILabel alloc]init];
        _number.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _number.font =[UIFont systemFontOfSize:WidthScale(11)];
    }
    return _number;
}
-(UIButton *)comm
{
    if (!_comm)
    {
        _comm =[[UIButton alloc]init];
    }
    return _comm;
}
-(UILabel *)commtext
{
    if (!_commtext)
    {
        _commtext =[[UILabel alloc]init];
        _commtext.textColor =[UIColor colorWithHexString:@"#FFFFFF"];
        _commtext.font =[UIFont systemFontOfSize:WidthScale(11)];
    }
    return _commtext;
}
-(UILabel *)XX
{
    if (!_XX)
    {
        _XX =[[UILabel alloc]init];
    }
    return _XX;
}
- (void)setFrame:(CGRect)frame
{
    frame.origin.x += 0;
    frame.origin.y -= 5;
    frame.size.height -= 5;
    frame.size.width -= 0;
    [super setFrame:frame];
}
-(UILabel *)daytime
{
    if (!_daytime)
    {
        _daytime = [[UILabel alloc]init];
        _daytime.textColor = [UIColor colorWithHexString:@"#FFFFFF"];
        _daytime.font =[UIFont systemFontOfSize:WidthScale(15)];
    }
    return _daytime;
}

@end
